package com.smart.wap.bodys;

import com.smart.common.entities.core.BaseSearch;
import com.smart.common.entities.domain.SmartPattern;
import com.smart.manager.work.entities.assembler.WorkOrder;
import com.smart.manager.work.entities.enums.PigOrderKind;
import com.smart.manager.work.entities.enums.PigOrderStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author leo
 * @date 2023/09/25
 */
public class WorkStaffBody {

    @Data
    @ApiModel("WorkStaffBody1")
    public static class NewBody implements Serializable {

        @ApiModelProperty( value = "管家名称" ,required = true)
        @NotBlank(message = "管家名称 不能为空")
        private String name;

        @ApiModelProperty(value = "手机号", required = true)
        @NotBlank(message = "手机号 不能为空")
        @Pattern(regexp = SmartPattern.PHONE, message = "手机号码 格式不正确")
        private String phone;

        @ApiModelProperty("头像")
        @NotBlank(message = "头像 不能为空")
        private String avatar;
    }


    /**
     * 入圈工单
     * @author leo
     * @date 2023/10/26
     */
    @Data
    @Accessors(chain = true)
    public static class addBody implements Serializable{

        @ApiModelProperty("工单编号")
        @NotBlank(message = "工单编号 不能为空")
        private String code;

        @ApiModelProperty(value = "订单内容")
        @NotNull(message = "入圈工单 不能为空")
        @Valid
        private WorkOrder.EnterTheCircleBody content;

    }


    @Data
    @Accessors(chain = true)
    public static class distributeBody implements Serializable{

        @ApiModelProperty("工单编号")
        @NotBlank(message = "工单编号 不能为空")
        private String code;

        @ApiModelProperty("员工编号")
        @NotBlank(message = "员工编号 不能为空")
        private String staffCode;
    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    public static class Search extends BaseSearch {

        @ApiModelProperty("工单状态")
        private PigOrderStatus status;

        @ApiModelProperty("工单类型")
        private PigOrderKind kind;


    }


    @EqualsAndHashCode(callSuper = true)
    @Data
    public static class SetInfo extends BaseSearch {

        @ApiModelProperty("工单状态")
        @NotBlank(message = "头像不能为空 ")
        private String avatarUrl;

    }
}
